static void
enigma_waypt_disp(const Waypoint* wpt)
{
- char* t;
#if NEW_STRINGS
if (!wpt->shortname.isEmpty()) {
// The output might have a space or control character.
// The output might have a space or control character.
int i, l = strlen(wpt->shortname);
#endif
- t = (char*) xmalloc(l + 1);
+ char *t = (char*) xmalloc(l + 1);
char* d = t;
for (i = 0; i < l; i++) {
#if NEW_STRINGS
}
}
*d = 0;
+ gbfprintf(file_out, "%s %f %f\n", t, wpt->latitude, wpt->longitude);
+ xfree(t);
} else {
- t = "NONAME";
+ gbfprintf(file_out, "%s %f %f\n", "NONAME", wpt->latitude, wpt->longitude);
}
- gbfprintf(file_out, "%s %f %f\n", t, wpt->latitude, wpt->longitude);
- xfree(t);
}
static void
get_option(const char* iarglist, const char* argname)
#endif
{
- size_t arglen = strlen(argname);
+ const size_t arglen = strlen(argname);
char* arglist;
char* rval = NULL;
char* arg;
return NULL;
}
- arglen = strlen(argname);
arglist = xstrdup(iarglist);
for (arg = arglist; argp = strtok(arg, ","), NULL != argp; arg = NULL) {